<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<title>投注</title>
		<%-- <%@include file="/WEB-INF/pcCommon.jspf"%> --%>
		<link rel="stylesheet" href="/pc-static/css/touzhu.css">
		<link rel="stylesheet" href="/pc-static/css/common.css">
		<link rel="stylesheet" href="/css/animate.min.css">
		<link rel="stylesheet" href="/css/jquery.dataTables.min.css" />
		<link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css" />
		<link rel="stylesheet" href="/layui/css/layui.css">
		<script src="/layui/layui.js"></script>
		<script src="/layui/layui.all.js"></script> 
		<script type="text/javascript" src="/js/jq.js"></script>
		<script type="text/javascript" src="/js/global.js"></script>
		<script type="text/javascript" src="/js/howler.min.js"></script>
		<script type="text/javascript" src="/bootstrap/js/bootstrap.min.js"></script>
		<script type="text/javascript"  src="/js/jquery.dataTables.min.js"></script>	
		<style>
			html{
				font-size: 16px !important;
			}
			body {
			    background: #f1f1f1;
			    overflow-y: auto;
				-webkit-overflow-scrolling : touch;
			}
			h1{
				    margin: 0;
			}
			a:hover{
				text-decoration: none;
			}
			.klsf{
				width:30px !important;
				height: 30px !important;
			}
			
			.klsf1{
				width:40px !important;
				height: 40px !important;
			}
			
			.react-skeleton-load {
				line-height: 1;
				display: inline-block;
				overflow: hidden;
				position: relative;
			}
			
			.react-skeleton-load.animated::before {
				content: '';
				position: absolute;
				height: 100%;
				width: 500px;
				top: 0;
				left: -500px;
				background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
				animation: progress 1.2s ease-in-out infinite
			}
			
			@keyframes progress {
				0% {
					left: -500px
				}
				100% {
					left: 100%
				}
			}
			.my-order .noData{
				display: block;	
			}
			
			.row {
			    margin: 11px 0;
		    /* margin-right: -15px; */
		    /* margin-left: -15px; */
		}
			
		.my-order .noData .list {
		    display: -ms-flexbox;
		    display: flex;
		    -ms-flex-align: center;
		    align-items: center;
		    font-size: 12px;
		    color: #666;
		}
		.my-order .noData .list {
		    height: 36px;
		    border-bottom: 1px dashed #ddd;
		    -ms-flex-pack: distribute;
		    justify-content: space-around;
		    -ms-flex-direction: row;
		    flex-direction: row;
		}
		.my-order .noData .list div{
			width:33%;
			text-align: center;
		}
		
		.form-control {
    display: block;
    width: 93%;
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin: 12px auto;
    font-size: 16px;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
    -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
    -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
    transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}
		
		.my-order .more {
	    display: block;
	    border: 1px solid #eb0e0e;
	    color: #eb0e0e;
	    border-radius: 3px;
	    display: -ms-flexbox;
	    display: flex;
	    -ms-flex-align: center;
	    align-items: center;
	    height: 26px;
	    margin: 15px 4px;
	}
	
	.ball.pcdd.hb{
		background: #F02828 !important;
	}
	
	.ball.pcdd.lanb{
		background: #336DCC !important;
	}
	
	.ball.pcdd.lvb{
		background: #09B832 !important;
	}
	
	.table-bordered{
		font-size: 16px;
	}
	
	ul{
		margin:0;
	} 
	
	.nothing{
		text-align: center;
		color:#999;
		line-height: 30px;
	}

		</style>
</head>
<body>
	<div id="loading" class="kd-loading">
		<div class="kd-spinner">
			<span class="bounce b1"></span>
			<span class="bounce b2"></span>
			<span class="bounce b3"></span>
		</div>
		<p>&nbsp;</p>
		<p>&nbsp;</p>
		<p>请稍等，努力加载中...</p>
	</div>
<div class='wapper' style="display:none">
	<div id="root">
			<div class="App">
				<div class="header" style="width:100%;">
					<div class="headerRow">
						<a onclick="pageChange('/pc/mobilegc.do','')">
							<div class="download"><i class="iconfont icon-phone"></i><span>手机购彩</span></div>
						</a>
						
						<a style="margin-left: 30px" class="index" href="/pc/index.do">返回首页</a>
							<span style="color:#f1f1f1">|</span>
						<a class="all" onclick="pageChange('/pc/lotter.do','')">全部彩种</a>
								
						<a href=""><img class="logo" alt="" ></a>
						<div class="memberMenu">
							<div class="memberMenuItem">
								<a class='link-kefu'>联系客服</a>
							</div>
							<span style="color:#f1f1f1">|</span>
							<div role="presentation" class="memberMenuItem tryplay" >免费试玩</div>
							<div role="presentation" class="backLogin" style="display:none" >退出</div>
						</div>
					</div>
				</div>
				<div tabindex="-1" role="group" style="outline: none;">
					<div class="playModule">
						<div class="playHeader">
							<div>
								
							</div>
						</div>
						<div class="warp">
							<div class="left">
								<div class="lottery">
									<div class='lotteryType'></div> 
									
			<!-- ===============================  下注主体        ==================================== -->
 
									<div class="game-main">
										<div class="game-main__head" >
											<ul class="nostyle playing-methods clearfix"></ul>
											<div class="bet-form clearfix has-chips">
												<div class="bet-form__chips">
													<a class="kd-button kd-button--fit"><i class="icon icon-setting-3"></i>筹码设置</a>
													<ul class="nostyle kd-chips">
														<li class="kd-chip chip7"><span>5</span></li>
														<li class="kd-chip chip8"><span>10</span></li>
														<li class="kd-chip chip9"><span>20</span></li>
														<li class="kd-chip"><span>50</span></li>
														<li class="kd-chip chip1"><span>100</span></li>
													</ul>
												</div> 
												<div class="bet-form__main">
													<div class="kd-textinput">
														<div class="kd-textinput__icon"><span>注数</span></div>
														 <input class="zhushu" type="number" min="0" step="0.01" value="0" disabled="disabled">
													</div>
													<div class="kd-textinput">
														<div class="kd-textinput__icon"><span>金额</span></div>
														 <input type="number" class="jine" value="2" min="1"  pstep="0.01" >

													</div>
													<div type="button" class="kd-button kd-button kd-button--fit recat">重置 <button type="button">Button</button></div>
													<div type="button" class="kd-button kd-button--fit bet-form__submit"><span class="tijiao">提交注单</span><button type="button">Button</button></div>
												</div>
											</div>
										</div>
									</div>
									<div class="game-main__body">
									</div>
								</div>
							</div>
							<div class="right">
								<div class="warp">
									<div class="record-prize">
										<div class="title">历史开奖</div>
										<div class="group">
										</div>
									</div>
									<div class="my-order" id="haha">
										<div class="title">我的投注</div>
										<div class="thead">
											<div>期号</div>
											<div>投注金额</div>
											<div>奖金</div>
										</div>
										<div class="noData"><div class='nothing'>暂无数据</div></div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class='div-c-noticeContentDiv animated bounceOut'>
			<div class='noticeContentInner'>
				<img alt='' src='/pc-static/img/tips.png'/>
				<div class='message-tip-body'></div>
				<a class='kg-close'></a>
			</div>
		</div>
		
		<div class="free_play_modal">
		  <div class="inner">
		  <input id="tryPlayAcount" type="text" value="" placeholder="请输入试玩用户名" class="form-control input-lg">
		  <input id="tryPlayPwd" type="password" placeholder="请输入密码" class="form-control input-lg">
		    <p>试玩账号只供玩家熟悉游戏。不允许充值和提款，且不享有参加优惠活动的权利，有效时间为<em>72小时。</em></p>
		    <div class="btn-wrapper">
		      <button id="free_play_no">暂不试玩</button>
		      <button id="free_play_yes">立即试玩</button>
		    </div>
		  </div>
		</div>
		

</div>
<!-- /.modal -->
		<script>
		
		document.onreadystatechange = function(){ 
			　　 if(document.readyState == "complete"){ 　　//当页面加载状态为完全结束时进入 
			    　 //你要做的操作。
				 $(".wapper").show() 
				 $(".kd-loading").hide()
			   　 }
			}
		var whetherToLogin = true
		$.ajax({
			url: "/users/userInfos.do",
			type: "post",
			data: {},
			success: function(data) {
				if(data.data==undefined){
					whetherToLogin=false;
					$(".tryplay")[0].style.display="inline-block"
					$(".backLogin").hide();
				}else{
					whetherToLogin=true;
					$(".backLogin")[0].style.display="inline-block"
					$(".tryplay").hide();
				}
			}
		})
		
		
		
		var lotter_count =0;//下注注数
		var lotter_rebate ="";//下注中奖最高赔率
			var cname=getUrlParam('cname');
			var price=getUrlParam('price');
			if(price==""){
				price=2
			}
			$(".jine").on("blur",function(){
				if($(".jine").val()<1 || $(".jine").val()=="" ){
					$(".jine").val(1)
				}
			})
			
			var SXobj={
					"狗":["02","14","26","38"],
					"鸡":["03","15","27","39"],
					"猴":["04","16","28","40"],
					"羊":["05","17","29","41"],
					"马":["06","18","30","42"],
					"蛇":["07","19","31","43"],
					"龙":["08","20","32","44"],
					"兔":["09","21","33","45"],
					"虎":["10","22","34","46"],
					"牛":["11","23","35","47"],
					"鼠":["12","24","36","48"],
					"猪":["01","13","25","37","49"],
			}
			var hongbo = ['1', '2', '7', '8', '12', '13','18', '19', '23', '24'];
			var lanbo = ['3', '4', '9', '10', '14', '15', '20', '25', '26'];
			var lvbo= ['0','5', '6', '11','16', '17', '21', '22', '27'];
			var shengxiao=["鸡","猴","羊","马","蛇","龙","兔","虎","牛","鼠","猪","狗"]
			var pk10_play=["冠","亚","季","四","五","六","七","八","九","十"]
			var three_figure_play=["百","十","个"]
			var four_figure_play=["百","十","个","总"]
			var five_figure_play=["万","千","百","十","个"]
			$(".jine").val(price)
			 var daojishi = 0   
			$.ajax({
				url: "/syLotterrs.do",//返回当前彩种的 赔率以及开奖数据
				type: "post",
				data: {cname:cname},
				success: function(data) {
					 var item=data.data;
					$("div").data("newData",item)
					var curTime=new Date(data.message).getTime(); //当前系统毫秒时间
					var nextTime=new Date(item.nextStopOrderTimeEpoch).getTime();//下棋开奖时间
					var countdown=(nextTime-curTime)/1000;  //倒计时时间
					daojishi = countdown
					DaoJiShiTask(item.timespace)//倒计时时间间隔
					bindAinmData(item,item.name)
					jinlaizhixing()//某个彩种的开奖记录
					bindlotter()
				}
			})
			
				function bindAinmData(item,names){
							var lotter=""
							var lotterNumber=item.lotternumber;
							var $lotteryType=$(".lotteryType");//彩票类型
							$lotteryType.empty();
							var y=""
							var z=""
							var d=""
							var x=""
							var totalLen=""
							lotterNumber=lotterNumber.split(",");
								if(item.cname=="2fpk10" || item.cname=="bjpk10"  || item.cname=="xysm"  || item.cname=="xyft" || item.cname=="2fft"){
									for(j=0;j<lotterNumber.length-1;j++){
										y+="<span class='_ele-motor'><em class='_ele-motor-mark'>"+Number(j+1)+"</em></span>"
										z+="<li class='_item _item-"+Number(j+1)+"'>"+
												"<span class='_ele-number ball_bjsc_"+lotterNumber[j]+"' id='last_result_"+j+"'>"+Number(j+1)+"</span>"+
												"<span class='_ele-mark'>"+pk10_play[j]+"</span>"+
											"</li>"
										d+="<li class='_item'></li>"
										
									}
									x+="<div class='dsLotto-result dsLotto-result--pk10 status--off'>"+
											"<div class='_scene-animation _scene-wait'>"+
												"<div class='_front-animation'>"+
												y+
												"</div>"+
												"<div class='_counter-animation'>"+
													"<ul>"+
														"<li>3</li>"+
														"<li>2</li>"+
														"<li>1</li>"+
														"<li>0</li>"+
													"</ul>"+
												"</div>"+
											"</div>"+
											"<div class='_scene-animation _scene-finish'>"+
												"<ul class='_group array cf'>"+
												z+
												"</ul>"+
											"</div>"+
											"<div class='_scene-animation _scene-bg'>"+
												"<ul class='_group array cf'>"+
												d+
												"</ul>"+
											"</div>"+
										"</div>"
								 }else if(item.cname=="xg6hc" || item.cname=="5f6hc"){
									 for(j=0;j<lotterNumber.length-1;j++){
										 for(k=1;k<50;k++){
											 if(k<10){
												 k="0"+k
											 }
											 z+="<li class='ico-farm mark_"+k+"'>"+k+"</li>"
										 }
										 for(m=0;m<shengxiao.length;m++){
											var ZMitem=shengxiao[m]
											if(SXobj[ZMitem].indexOf(lotterNumber[j])!=-1){
												 d+="<li id='last_result_sx_"+j+"'>"+ZMitem+"</li>"
											}
										}
										 y+="<li class='item-"+Number(j+1)+" ico-farm'>"+
							            	"<div class='_ele-number mark_"+lotterNumber[j]+"' id='last_result_hm_"+j+"'>"+lotterNumber[j]+"</div>"+
							            	"<div class='_ele-unknown' style='animation-delay:"+(Number(j+1)*200)+"ms'>"+
							                    "<ul>"+
							                    z+
							                    "</ul>"+
							                "</div>"+
							            "</li>"
									 }
									 x+="<div class='dsLotto-result dsLotto-rs dsLotto-rs--2r8c dsLotto-rs--xy status--off'>"+
									    "<div class='ui-row ui-row-i'>"+
									       " <ul class='array cf'>"+
									       	y+
									        "</ul>"+
									    "</div>"+
									    "<div class='ui-row ui-row-ii'>"+
									        "<ul class='array cf'>"+
									        d+
									        "</ul>"+
									   "</div>"+
									"</div>"
								 }else if(item.cname=="gdkl10f" || item.cname=="cqkl10f"){
									 for(j=0;j<lotterNumber.length-1;j++){
										 for(k=1;k<21;k++){
											 if(k<10){
												 k="0"+k
											 }
											 z+="<li class='ico-farm _ele_cqxync_"+k+"'></li>"
										 }
										 y+="<li class='item-"+Number(j+1)+" ico-farm'>"+
												"<div class='_ele-number _ele_cqxync_"+lotterNumber[j]+"' id='last_result_kl10f_"+Number(j+1)+"'></div>"+
	            								"<div class='_ele-unknown' style='animation-delay:"+(Number(j+1)*200)+"ms'>"+
	            									"<ul>"+
	            										z+
	            									"</ul>"+
	            								"</div>"+
											"</li>"
									 }
									 x+="<div class='dsLotto-result dsLotto-rs dsLotto-rs--cqxync dsLotto-rs--xy status--off'>"+
										 "<div class='ui-row ui-row-i'>"+
											"<ul class='array cf'>"+
												y+
											"</ul>"+
										"</div>"+
									"</div>"
								 }else if(item.cname.indexOf("28")!=-1){
									 var total=0
									 for(j=0;j<7;j++){
										 for(k=0;k<10;k++){
											 z+="<li>"+k+"</li>"
										 }
										 
										 
										 
										 if(j%2!=0){
											 if(j==5){
												 y+= "<li class='_item _item_add'>"+
													"<div class='_ele-number_add ng-binding'>=</div>"+
												"</li>"
											 }else{
												 y+= "<li class='_item _item_add'>"+
													"<div class='_ele-number_add ng-binding'>+</div>"+
												"</li>"
											 }
										 }else{
											 total+=Number(lotterNumber[j/2])
											 if(j==6){
												 for(k=0;k<28;k++){
													 totalLen+="<li>"+k+"</li>"
												 }
												 y+="<li class='_item' style='margin-left: 0;'>"+
													"<div class='_ele-number ng-binding' id='last_result_"+j+"'>"+total+"</div>"+
													"<div class='_ele-unknown' style='animation-delay: "+Number(j/2+1)*100+"ms'>"+
														"<ul>"+
															totalLen+
														"</ul>"+
													"</div>"+
													"<div class='_ele-mark'>"+four_figure_play[j/2]+"</div>"+
												"</li>"
											 }else{
												 y+="<li class='_item' style='margin-left: 0;'>"+
													"<div class='_ele-number ng-binding' id='last_result_"+j+"'>"+lotterNumber[j/2]+"</div>"+
													"<div class='_ele-unknown' style='animation-delay: "+Number(j/2+1)*100+"ms'>"+
														"<ul>"+
															z+
														"</ul>"+
													"</div>"+
													"<div class='_ele-mark'>"+four_figure_play[j/2]+"</div>"+
												"</li>" 
											 }
										 }
									 }
									 x+="<div class='dsLotto-result dsLotto-result--no5 dsLotto-result--no7 status--off'>"+
										"<ul class='_group array cf'>"+
										y+
										"</ul>"+
									"</div>"
								 }else{
									 if(item.cname.indexOf("k3")!=-1 || item.cname=="fc3d" || item.cname=="pl3" || item.cname=="shssl" ){
										 for(j=0;j<lotterNumber.length-1;j++){
											 for(k=0;k<10;k++){
												 z+="<li>"+k+"</li>"
											 }
											 y+="<li class='_item' style='margin-left: 0;'>"+
												"<div class='_ele-number ng-binding' id='last_result_"+j+"'>"+lotterNumber[j]+"</div>"+
												"<div class='_ele-unknown' style='animation-delay: "+Number(j+1)*100+"ms'>"+
													"<ul>"+
														z+
													"</ul>"+
												"</div>"+
												"<div class='_ele-mark'>"+three_figure_play[j]+"</div>"+
											"</li>"
										 }
										 x+="<div class='dsLotto-result dsLotto-result--no5 dsLotto-result--no3 status--off'>"+
											"<ul class='_group array cf'>"+
											y+
											"</ul>"+
										"</div>"
									 }else{
										 for(j=0;j<lotterNumber.length-1;j++){
											 for(k=0;k<10;k++){
												 z+="<li>"+k+"</li>"
											 }
											 y+="<li class='_item' style='margin-left: 0;'>"+
												"<div class='_ele-number ng-binding' id='last_result_"+j+"'>"+lotterNumber[j]+"</div>"+
												"<div class='_ele-unknown' style='animation-delay: "+Number(j+1)*100+"ms'>"+
													"<ul>"+
														z+
													"</ul>"+
												"</div>"+
												"<div class='_ele-mark'>"+five_figure_play[j]+"</div>"+
											"</li>"
										 }
										 x+="<div class='dsLotto-result dsLotto-result--no5 status--off'>"+
											"<ul class='_group array cf'>"+
											y+
											"</ul>"+
										"</div>" 
									 }
								}
							lotter="<div class='detail'>"+
							"<div class='logo'><img src='/img/caizhong/"+item.cname+".png' alt=''></div>"+
							"<div class='info'>"+
								"<div><span class='name'>"+names+"</span></div>"+
								"<div>"+
									"<a id='gotoZoushi'><i class='iconfont icon-TVMovement'></i>走势</a>"+
									"<a id='gotoRule' ><i class='iconfont icon-ruleEmpty'></i>规则</a>"+
								"</div>"+
							"</div>"+
						"</div>"+
						"<div class='lottery-detail'>"+
							"<div class='lottertInfo'>"+
								"<div class='lottery-time'>"+
									"<div class='prompt'><span>距离</span><span class='nextperiod'>"+item.nextperiod+"</span><span>期关盘还有:</span></div>"+
									"<div class='time'>"+
										"<div><span class='hh'>00</span></div>:"+
										"<div><span class='mm'>00</span></div>:"+
										"<div><span class='ss'>00</span></div>"+
									"</div>"+ 
								"</div>"+
								"<div id='showgd-box'>"+
									"<ul class='box-ul'>"+
										"<li><a id='#gd-box1' class='tabulous_active'>近一期</a></li>"+
										"<li><a class='' id='#gd-box2'>近五期</a></li>"+
										"<span class='tabulousclear'></span>"+
									"</ul>"+
									"<div id='tabs_container' style='height: 120px;' class='transition'>"+
										"<div id='gd-box1' style='position: absolute; top: 40px;' class='make_transist hideleft showleft'>"+
											"<div class='dsLotto-prev right1'>"+
												<!-- / 开奖(CQ/XJSSC+GX10) -->
												"<div class='row dsLotto-prev-sn'>"+
													"<ul class='array ac cf'>"+
														"<li class='page_name'>"+names+"</li>"+
														"<li>第<span class='red qihao' id='last_qihao'>"+item.period+"</span>期开奖结果"+
														"</li>"+
														"<li class='kj_state' style='width:50px;'></li>"+
														/* "<li style='width:50px;'><span class='red' id='readyOpen' style='display: block;width: inherit;'>开奖中...</span></li>"+ */
													"</ul>"+
													"<span title='关闭音效' class='musicFlag dsLotto-block-sound'></span>"+
												"</div>"+
											"</div>"+
										"</div>"+
										"<div id='gd-box2' class='hideleft make_transist' style='position: absolute; top: 40px;'>"+
										"</div>"+
									"</div>"+
								"</div>"+
							"</div>"+
						"</div>"
						$lotteryType.append(lotter);
						$("#gd-box1 .right1").append(x);
						$("#gotoZoushi").on("click",function(){
							pageChange("/pc/trendChart.do",cname)  //走勢
						})
						
						$("#gotoRule").on("click",function(){
							pageChange("/pc/rule.do",cname)  //規則
						})
				}
			
			function jinlaizhixing(){
				$.ajax({
					url: "/caizhongjl.do",//某个彩种的开奖记录
					type: "post",
					data: {"cname":cname},
					success: function(data) {
						initActivityList(data)
						CurrentfiveDetail()
					}
				})
			}
			function CurrentfiveDetail(){  //点击查看最近5期的详情
				$("#showgd-box .box-ul li").on("click",function(){
					 var index=$(this).index() 
					$(this).find("a").addClass("tabulous_active")
					$(this).siblings().find("a").removeClass("tabulous_active")
					$("#gd-box"+Number(index+1)).addClass("showleft").siblings().removeClass("showleft")
				})
			}
			
			
			var xiafnextPeriod
			var states = true
			function DaoJiShiTask(timespace){
				//倒计时时间
				DaoJiShi()
				 function DaoJiShi(){
					 daojishi--;
				 	var h = parseInt(daojishi/ 60 / 60 % 60) //时
				    var m = parseInt(daojishi/ 60 % 60)  //分
				 	var s = parseInt(daojishi% 60)  //秒
				 	
				 	if(h <= 0 && m <= 0 && s <= -1){
				 		$(".lottery-time .time").html("<div><span class='hh'>00</span></div>:"+
								"<div><span class='mm'>00</span></div>:"+
								"<div><span class='ss'>00</span></div>")
				 	/* }
				 	if(h <= 0 && m <= 0 && s <= -1){ */   //此处修改过原来的逻辑把-1换成了0
				 		
				 		//$(".lottery-time .time").html("<span style='display:flex;width:170px;justify-content: center;align-items: center;line-height:52px'>正在开奖</span>")
				 	/* 	if(h <= 0 && m <= 0 && s == 0){
					 		
				 		} */
						$(".dsLotto-result").removeClass("status--off").addClass("status--on")
						states= true
					}else{
						if(h<10){
					 		h="0"+h
					 	}
					 	if(m<10){
					 		m="0"+m
					 	}
					 	if(s<10){
					 		s="0"+s
					 	}
					 	if(h==0 && m==0 && s<=10 && s>0){   //播放倒计时声音
					 		if(s%2==0){
					 			if(!$(".musicFlag").hasClass("status--off")){
					 				LotDown.play();    //每两秒播放一次声音
								}
					 		}else{
					 			if(!$(".musicFlag").hasClass("status--off")){
					 				LotDown.play();    //每两秒播放一次声音
								}
					 		}
					 		
					 	}
						$(".lottery-time .time").html("<div><span class='hh'>"+h+"</span></div>:"+
							"<div><span class='mm'>"+m+"</span></div>:"+
							"<div><span class='ss'>"+s+"</span></div>") 
					}
				 	if(h <= 0 && m <= 0 && s <= 30){//开奖前30秒封盘
					  $(".playModule .tijiao").text("已封盘")
				 	}else{
				 		$(".playModule .tijiao").text("提交注单")
				 	}
				 	if(states){
				 		$.ajax({
							url: "/findNextNextPeriod.do",
							type: "post",
							data: {
								"cname":cname,
								"type":1  // 0 是国彩  1是系统彩
							},
							success: function(data) {
								var html=""
								$(".kj_state").empty();
								var fnextPeriod = data.data.nextperiod
								var nextPeriod = $(".nextperiod").text()//页面期号
								var newData=data.data;
								if(fnextPeriod > nextPeriod){
									$(".nextperiod").text(fnextPeriod)//下期期号
									$(".qihao").text(data.data.period)//写入期号
									var curTime=new Date(data.message).getTime(); //当前系统毫秒时间
									var nextTime=new Date(data.data.nextStopOrderTimeEpoch).getTime();//下棋开奖时间
									daojishi =(nextTime-curTime)/1000;  //倒计时时间
								}
								//if(daojishi >= 0){
					 			if(nextPeriod >= data.data.period){
									var lotternumber = data.data.lotternumber
									if(lotternumber != null && daojishi >= 1){
										states = false;
										$("kj_state").html("")
										$(".dsLotto-result").removeClass("status--on").addClass("status--off")
										jinlaizhixing()
										$(".kj_state").empty();
										bindAinmData(newData,newData.gameNameInChinese)
									}else{
										html="<span class='red' id='readyOpen' style='display: block;width: inherit;'>开奖中...</span>"
										$(".kj_state").append(html)
										$(".dsLotto-result").removeClass("status--off").addClass("status--on")
									}
								}
							//}
							}
						})
				 	}
				 }
				 var timer = setInterval(DaoJiShi, 1000);
			}
			function newActiveItem2(item){
				if(item.cname=="2fpk10" || item.cname=="bjpk10"  || item.cname=="xysm"  || item.cname=="xyft" || item.cname=="2fft" || item.cname.indexOf("6hc")!=-1){
					$("#gd-box2").css("padding","0")
					$("#gd-box2").css("font-size","13px")
				}else{
					$("#gd-box2").css("padding","5px 0 0 10px")
					$("#gd-box2").css("font-size","14px")
				}
				var lotternumber=item.lotternumber.split(",")
				var w=""
				if(item.cname.indexOf("6hc")!=-1){
					for(i=0;i<lotternumber.length-1;i++){
						if(i<lotternumber.length-2){
							if(redArr.indexOf(lotternumber[i])!=-1){
								w+="<span class='gd-box-lhc bg1'>"+lotternumber[i]+"</span>"
							}else if(blueArr.indexOf(lotternumber[i])!=-1){
								w+="<span class='gd-box-lhc bg2'>"+lotternumber[i]+"</span>"
							}else{
								w+="<span class='gd-box-lhc bg4'>"+lotternumber[i]+"</span>"
							}
						}else if(i==lotternumber.length-2){
							if(redArr.indexOf(lotternumber[i])!=-1){
								w+="<span class='plus_lhc'>+</span><span class='gd-box-lhc bg1'>"+lotternumber[i]+"</span>"
							}else if(blueArr.indexOf(lotternumber[i])!=-1){
								w+="<span class='plus_lhc'>+</span><span class='gd-box-lhc bg2'>"+lotternumber[i]+"</span>"
							}else{
								w+="<span class='plus_lhc'>+</span><span class='gd-box-lhc bg4'>"+lotternumber[i]+"</span>"
							}
						}
						
					}
				}else if(item.cname.indexOf("28")!=-1){
					var total=0;
					for(i=0;i<7;i++){
						if(i%2!=0){
							if(i==5){
								w+="<span class='gd-box-h'>=</span>"
							}else{
								w+="<span class='gd-box-h'>+</span>"
							}
						}else{
							total+=Number(lotternumber[i/2])
							if(i==6){
								w+="<span class='gd-box-h'>"+total+"</span>"
							}else{
								w+="<span class='gd-box-h'>"+lotternumber[i/2]+"</span>"
							}
						}
					}
				}else{
					for(i=0;i<lotternumber.length-1;i++){
						w+="<span class='gd-box-h'>"+lotternumber[i]+"</span>"
					}
					if(item.cname.indexOf("ssc")!=-1){
						w+="<span class='gd-box-h'>"+item.playResult.substring(0,1)+"</span>"+"<span class='gd-box-h'>"+item.playResult.substring(1,2)+"</span>"+"<span class='gd-box-h'>"+item.playResult.substring(3,4)+"</span>"
					}
				}	
				
				var html1="<p>第 <span class='gd-box-q'>"+item.period+"</span> 期:&nbsp;&nbsp;"+
							w+
						"</p>"
				return html1
			}
			
			function newActiveItem(item) {
				var d = item.lotternumber.split(",")
				var total=0;
				var html = "<div class='list'>"+
				 "<div class='date'><span>"+item.period+"期</span></div>"+
				 "<div class='number'>"
					 for(i=0;i<d.length-1;i++){
							if(item.cname=="2fpk10" || item.cname=="bjpk10"  || item.cname=="xysm"  || item.cname=="xyft"  || item.cname=="2fft"){
								html+="<div class='ball qiu"+Number(d[i])+"'>"+d[i]+"</div>"
							} else if(item.cname=="xg6hc" || item.cname=="5f6hc"){
								if(i==d.length-2){
									html+="<div style='font-size:16px;font-weight:bold;color:black'>+</div>";
								}
								html+="<div><div class='ball xg"+Number(d[i])+"'>"+d[i]+"</div>"
								for(y=0;y<shengxiao.length;y++){
									var ZMitem=shengxiao[y]
									if(SXobj[ZMitem].indexOf(d[i])!=-1){
										html+="<div>"+ZMitem+"</div></div>"
									}
								}
							} else if(item.cname=="ahk3" || item.cname=="gxk3" || item.cname=="jsk3" || item.cname=="3fk3" || item.cname=="bjk3" || item.cname=="2fk3"){
								html+="<div class='ball sz"+d[i]+"'></div>"
							} else if(item.cname.indexOf("28")!=-1){
								total+=Number(d[i])
								if(hongbo.indexOf(d[i])!=-1){
									html+="<div class='ball pcdd hb'>"+d[i]+"</div>"
								}else if(lanbo.indexOf(d[i])!=-1){
									html+="<div class='ball pcdd lanb'>"+d[i]+"</div>"
								}else if(lvbo.indexOf(d[i])!=-1){
									html+="<div class='ball pcdd lvb'>"+d[i]+"</div>"
								}
								if(i==0 || i==1){
									html+="<div>+</div>"
								}
								if(i==2){
									if(hongbo.indexOf(total+"")!=-1){
										html+="<div>=</div><div class='ball pcdd lvb'>"+total+"</div>"
									}else if(lanbo.indexOf(total+"")!=-1){
										html+="<div>=</div><div class='ball pcdd lvb'>"+total+"</div>"
									}else if(lvbo.indexOf(total+"")!=-1){
										html+="<div>=</div><div class='ball pcdd lvb'>"+total+"</div>"
									}
								}
							}else{
								html+="<div class='ball qiu8'>"+d[i]+"</div>"
							} 
						} 
					/*  html += "<div class='ball'>"+ii[i]+"</div>" */
				 html +=  "</div> "+
				 "</div>"
				return html
			}
			function initActivityList(data) {
				var $noticeList = $(".group")
				var gd_box2=$("#gd-box2")
				$noticeList.html("")
				gd_box2.html("")
				if(data.data.length > 5){
					 data.data.length = 5
				}
				for (var i = 0; i < data.data.length; i++) {
					var html = newActiveItem(data.data[i])
					var html1=newActiveItem2(data.data[i])  //查询最新动画的进5期详情
					$noticeList.append(html)
					gd_box2.append(html1)
				}
				$noticeList.append("<a id='gotoDraw'>更多</a>");
				$("#gotoDraw").on("click",function(){
					pageChange("/pc/drawdetail.do",cname)
				})
			}	
			
			
			function newActiveItem1(item) {
				if(item.state == 1){
					item.state = "待开奖"
				}
				if(item.state==2){
					item.state = "未中奖"
				}
				if(item.state==3){
					item.state = "已中奖"
				}
				if(item.state==6){
					item.state = "和局中奖"
				}
				if(item.state==7 || item.state==8 ){
					item.state = "已撤单"
				}
				item.period=item.period.substring(8,item.period.length)
				var html = "<div class='list'><div>"+item.period+"期</div><div>"+item.acount+"</div><div>"+item.state+"</div></div>"
				return html
			} 
			BindmyOrders()
			function BindmyOrders(){
				 $.ajax({
						url: "/orders/myOrders.do",
						type: "post",
						data: {
							pageCount:"1",
							startIndex:"0",
							lineCount:"5",
							cname:cname,
							state:10
						},
						success: function(data) {
						 var newData = JSON.parse(data)
						  if(newData.replace1 == 0){
							  /* PrentLayerLittle("提示","你还没有登录,登录后可投注噢") */
							 whetherToLogin = false
							  return
						  }else{
							 whetherToLogin = true
						  }
						var $noticeList = $(".noData")
						$noticeList.html("")
						for (var i = 0; i <newData.aaData.length; i++) {
							var html = newActiveItem1(newData.aaData[i])
							$noticeList.append(html)
						} 
						if(newData.aaData.length>0){
							 $noticeList.append("<a class='more' href='/pc/personal.do#transactionRecord'>更多</a>");
						}
						}
					}) 
			}
			
			function bindlotter(){
				 var newData = $("div").data(newData)
				 var data = newData.newData
				 var cnametype = data.classt.split(" ")[2]
				 var peilv1 = data.rebate1.split(",")
				 var peilv2 = data.rebate2.split(",")
				 var peilv3 = data.rebate3.split(",")
				 var peilv4 = data.rebate4.split(",")
				 var peilv5 = data.rebate5.split(",")
				 var peilv6 = data.rebate6.split(",")
				 var peilv7 = data.rebate7.split(",")
				 var peilv8 = data.rebate8.split(",")
				 var peilv9 = data.rebate9.split(",")
				 var peilv10 = data.rebate10.split(",")
				 var peilv11 = data.rebate11.split(",")
				 var peilv12 = data.rebate12.split(",")
				 var peilv13 = data.rebate13.split(",")
				 var peilv14 = data.rebate14.split(",")
				 var peilv15 = data.rebate15.split(",")
				 var peilv16 = data.rebate16.split(",")
				 var peilv17 = data.rebate17.split(",")
				 var peilv18 = data.rebate18.split(",")
				 var peilv19 = data.rebate19.split(",")
				 var peilv20 = data.rebate20.split(",")
				 var peilv21 = data.rebate21.split(",")
				 var peilv22 = data.rebate22.split(",")
				 var peilv23 = data.rebate23.split(",")
				 var peilv24 = data.rebate24.split(",")
				 var peilv25 = data.rebate25.split(",")
				 var peilv26 = data.rebate26.split(",")
				 var peilv27 = data.rebate27.split(",")
				 var peilv28 = data.rebate28.split(",")
				 var peilv29 = data.rebate29.split(",")
				 var peilv30 = data.rebate30.split(",")
				 var peilv31 = data.rebate31.split(",")
				 var peilv32 = data.rebate32.split(",")
				 var peilv33 = data.rebate33.split(",")
				 var peilv34 = data.rebate34.split(",")
				 var peilv35 = data.rebate35.split(",")
				 var peilv36 = data.rebate36.split(",")
				 var peilv37 = data.rebate37.split(",")
				 var peilv38 = data.rebate38.split(",")
				 var peilv39 = data.rebate39.split(",")
				 var peilv40 = data.rebate40.split(",")
				 var peilvArray = [peilv1,peilv2,peilv3,peilv4,peilv5,peilv6,peilv7,peilv8,peilv9,peilv10,peilv11,peilv12,peilv13,peilv14,peilv15,peilv16,peilv17,peilv18,peilv19,peilv20,peilv21,peilv22,peilv23,peilv24,peilv25,peilv26,peilv27,peilv28,peilv29,peilv30,peilv31,peilv32,peilv33,peilv34,peilv35,peilv36,peilv37,peilv38,peilv39,peilv40];
				 var $lotteryType=$(".game-main__body");
				 var $lotteryType1=$(".game-main__head .playing-methods");
				 $lotteryType.html("")
			  	 $lotteryType1.html("")
				 if(cnametype == "pk10"){
					var wanfa = ["冠亚和值","1-5名","6-10名"]
					var array=["单","双","大","小"] 
					var array1=["单","双","大","小","龙","虎"]
					$(".game-main__head").nextAll().remove();
					 var item = ""
					 for(var i = 0; i<wanfa.length;i++){
						 item += "<li class='playing-methods__item'>"+
							"<a data-id='ofsc-w2' class='item'>"+wanfa[i]+"</a>"+
							"</li>"
					 }
					if(cname=="bjpk10"){
						var flashCar="<embed class='flash_car' style='display:none' src='https://pk10.yb9.me/res/carracing.swf' quality='high' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='1010' height='543'>"
						$(".game-main__head").after(flashCar)
						item+="<li class='car_video'><a class='tznavhd_recentdraw' inited='true' status='on'>赛车视频<i class='ssqIcon-drop2'></i></a></li>"
						$lotteryType1.append(item)
						$(".car_video a").on("click",function(){
							if($(this).hasClass("active")){
								$(this).removeClass("active")
								$(".flash_car").hide()
							}else{
								$(this).addClass("active")
								$(".flash_car").show()
							}
						})
					}else{
						$lotteryType1.append(item)
					}
					
					
					var html = "<section data-max='2' class='playing-method-section'>"+
					 "<h1 class='playing-method-section-title'>"+wanfa[0]+"</h1>"+
					 "<ul class='nostyle kd-row lottery-balls'>"
					for(var i = 0;i<array.length ;i++){
						html +="<li class='playing-method__item'>"+
									"<ul class='playing-method__cells nostyle'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+array[i]+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilv1[i]+"</span></li>"+
									"</ul>"+
								"</li>"
					}
				 html += "</ul>"+
				 "</section>"
				
				var pk10array=["冠军","亚军","第3名","第4名","第5名","第6名","第7名","第8名","第9名","第10名"] 
				var html2 = ""
				for(var i = 0;i<10;i++){
					var html1 = ""
					if(i==0 || i==5){
						html1+="<section data-max='6' class='playing-method-section  playing-method-section--column playing-method-section--start'>"+
						"<h1 class='playing-method-section-title'>"+pk10array[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}else if(i == 4 || i==9){
						html1+="<section data-max='6' class='playing-method-section  playing-method-section--column playing-method-section--end'>"+
						"<h1 class='playing-method-section-title'>"+pk10array[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}else{
						html1+="<section data-max='6' class='playing-method-section  playing-method-section--column'>"+
						"<h1 class='playing-method-section-title'>"+pk10array[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}
					if(i<5){
						for(var j = 0;j<array1.length;j++){
							html1 += "<li class='playing-method__item'>"+
								"<ul class='playing-method__cells nostyle'>"+
									"<li class='playing-method__cell'><span class='lottery-prop ball'>"+array1[j]+"</span></li>"+
									"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i+1][j]+"</span></li>"+
								"</ul>"+
							"</li>"
						}
						for(var j = 0; j<10;j++){
							html1 += "<li class='playing-method__item'>"+
								"<ul class='playing-method__cells nostyle'>"+
									"<li class='playing-method__cell'><span class='lottery-ball pk10 solid ball"+Number(j+1)+"'>"+Number(j+1)+"</span></li>"+
									"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i+1][j+6]+"</span></li>"+
								"</ul>"+
							"</li>"
						}
					}else if(i<10){
						for(var j = 0;j<array.length;j++){
							html1 += "<li class='playing-method__item'>"+
								"<ul class='playing-method__cells nostyle'>"+
									"<li class='playing-method__cell'><span class='lottery-prop ball'>"+array[j]+"</span></li>"+
									"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i+1][j]+"</span></li>"+
								"</ul>"+
							"</li>"
						}
						for(var j = 0; j<10;j++){
							html1 += "<li class='playing-method__item'>"+
								"<ul class='playing-method__cells nostyle'>"+
									"<li class='playing-method__cell'><span class='lottery-ball pk10 solid ball"+Number(j+1)+"'>"+Number(j+1)+"</span></li>"+
									"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i+1][j+4]+"</span></li>"+
								"</ul>"+
							"</li>"
						}
					}
					html1 += "</ul>"+
					"</section>"
					html2+=html1
				}
					$lotteryType.append(html+html2)
					var qiu=$(".playing-method__cells .pk10")
					 for(i=0;i<qiu.length;i++){
						var item=qiu[i].innerHTML;
						if(item<10){
							qiu[i].innerHTML="0"+qiu[i].innerHTML;
						}
					} 
				}if(cnametype=="pcdd"){
					var wanfa=["混合","特码","特码包三","波色","豹子"]
					var array1=["大","小","单","双","大单","大双","小单","小双","极小","极大"]
					var array2=["红波","蓝波","绿波"]
					var html=""
					var item=""
					for(var i=0;i<wanfa.length;i++){
						var html1=""
					 	 item += "<li class='playing-methods__item'>"+
							"<a data-id='ofsc-w2' class='item'>"+wanfa[i]+"</a>"+
							"</li>" 
						
						if(i<wanfa.length-1){
							html1+="<section data-max='4' class='playing-method-section'>"+
							"<h1 class='playing-method-section-title'>"+wanfa[i]+"</h1>"+
							"<ul class='nostyle kd-row lottery-balls'>"
						}else if(i==wanfa.length-1){
							html1+="<section data-max='4' class='playing-method-section'>"+
							"<h1 class='playing-method-section-title'><span class='wfname'>"+wanfa[i]+"</span><span style='margin-left:50px;'>赔率："+peilvArray[i][0]+"</span></h1>"+
							"<ul class='nostyle kd-row lottery-balls'>"
						}
						if(i==0){
							for(j=0;j<array1.length;j++){
								html1 += "<li class='playing-method__item'>"+
											"<ul class='playing-method__cells nostyle'>"+
												"<li class='playing-method__cell'><span class='lottery-prop ball'>"+array1[j]+"</span></li>"+
												"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
											"</ul>"+
										"</li>"
							}
						}else if(i>0 && i<3){
							for(j=0;j<28;j++){
								if(hongbo.indexOf(j+"")!=-1){
									html1 += "<li class='playing-method__item lhcQiu'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-ball pcdd solid hb'>"+Number(j)+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}else if(lanbo.indexOf(j+"")!=-1){
									html1 += "<li class='playing-method__item lhcQiu'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-ball pcdd solid lanb'>"+Number(j)+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}else if(lvbo.indexOf(j+"")!=-1){
									html1 += "<li class='playing-method__item lhcQiu'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-ball pcdd solid lvb'>"+Number(j)+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
								
							}
						}else if(i==3){
							for(j=0;j<array2.length;j++){
								html1 += "<li class='playing-method__item colorWave'>"+
								"<ul class='playing-method__cells nostyle'>"+
									"<li class='playing-method__cell'><span class='lottery-prop ball'>"+array2[j]+"</span></li>"+
									"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}
						}else if(i==4){
							html1 += "<li class='playing-method__item all'>"+
							"<ul class='playing-method__cells nostyle'>"+
								"<li class='playing-method__cell'><span class='lottery-prop ball'>豹子</span></li>"+
							"</ul>"+
						"</li>"
						}	
						html1 += "</ul>"+
						"</section>"
						html+=html1	
					}
					$lotteryType1.append(item)
					$lotteryType.append(html)
				}
				 if(cnametype == "ssc"){
					 var wanfa = ["总和","1-5球","前三","中三","后三","连码"]
					 var array=["单","双","大","小","龙","虎","和"]
					 var array1=["单","双","大","小","0","1","2","3","4","5","6","7","8","9"]
					 var qzhsan=["豹子","顺子","对子","半顺","杂六"]
					 var item = ""
					 for(var i = 0; i<wanfa.length;i++){
						 item += "<li class='playing-methods__item'>"+
							"<a data-id='ofsc-w2' class='item'>"+wanfa[i]+"</a>"+
							"</li>"
					 }
					$lotteryType1.append(item)
					
					
				var sscarray=["总和","第一球","第二球","第三球","第四球","第五球","前三","中三","后三","连码-前二直选","连码-后二直选","连码-前三直选","连码-中三直选","连码-后三直选","连码-前二组选","连码-后二组选","连码-前三组六","连码-中三组六","连码-后三组六","连码-前三组三","连码-中三组三","连码-后三组三"] 
				/* var lianma=[] */
				var html = ""
				for(var i = 0;i<sscarray.length;i++){
					var html1 = ""
					if(i==0){
						html1+="<section data-max='4' class='playing-method-section'>"+
						"<h1 class='playing-method-section-title'>"+sscarray[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}
					else if(i==1){
						html1+="<section data-max='6' class='playing-method-section  playing-method-section--column playing-method-section--start' >"+
						"<h1 class='playing-method-section-title'>"+sscarray[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}else if(i<5 && i>1){
						html1+="<section data-max='6' class='playing-method-section  playing-method-section--column'  >"+
						"<h1 class='playing-method-section-title'>"+sscarray[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}
					else if(i == 5){
						html1+="<section data-max='6' class='playing-method-section  playing-method-section--column playing-method-section--end'>"+
						"<h1 class='playing-method-section-title'>"+sscarray[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}else{
						html1+="<section data-max='4' class='playing-method-section'>"+
						"<h1 class='playing-method-section-title'>"+sscarray[i]+"<span style='margin-left:50px;'>赔率："+peilvArray[i][0]+"</span></h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}
					if(i==0){
						for(var j = 0;j<array.length;j++){
							html1 += "<li class='playing-method__item'>"+
								"<ul class='playing-method__cells nostyle'>"+
									"<li class='playing-method__cell'><span class='lottery-prop ball'>"+array[j]+"</span></li>"+
									"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
								"</ul>"+
							"</li>"
						}
					}else if(i<6){
						for(var j = 0;j<array1.length;j++){
							if(j<4){
								html1 += "<li class='playing-method__item'>"+
								"<ul class='playing-method__cells nostyle'>"+
									"<li class='playing-method__cell'><span class='lottery-prop ball'>"+array1[j]+"</span></li>"+
									"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}else{
								html1 += "<li class='playing-method__item'>"+
								"<ul class='playing-method__cells nostyle'>"+
									"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ball0'>"+array1[j]+"</span></li>"+
									"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}
						}
					}else if(i<9){
						for(var j = 0;j<qzhsan.length;j++){
							html1 += "<li class='playing-method__item'>"+
							"<ul class='playing-method__cells nostyle'>"+
								"<li class='playing-method__cell'><span class='lottery-prop ball'>"+qzhsan[j]+"</span></li>"+
								"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else if(i<11){
						for(j=0;j<10;j++){
							html1 += "<li class='playing-method__item lianma'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(j=0;j<10;j++){
							html1 += "<li class='playing-method__item lianma'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc2'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else if(i<14){
						for(j=0;j<10;j++){
							html1 += "<li class='playing-method__item lianma'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(j=0;j<10;j++){
							html1 += "<li class='playing-method__item lianma'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc2'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(j=0;j<10;j++){
							html1 += "<li class='playing-method__item lianma'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc3'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else{
						for(j=0;j<10;j++){
							html1 += "<li class='playing-method__item lianma'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}
					html1 += "</ul>"+
					"</section>"
					html+=html1
				}
				$lotteryType.append(html)
				 }
				  if(cnametype == "kuai3"){
					 
					 var wanfa = ["猜一个号","三连号通选","二同号复选","二同号单选","二不同号","二不同号胆拖","三通号通选","三通号单选","三不同号","形态","总和"]
					 var total=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","大","小","单","双"]
					 var state=["豹子","顺子","对子","半顺","杂六"]
					 var item = ""
					 for(var i = 0; i<wanfa.length;i++){
						 item += "<li class='playing-methods__item'>"+
							"<a data-id='ofsc-w2' class='item'>"+wanfa[i]+"</a>"+
							"</li>"
					 }
					$lotteryType1.append(item)
				var html = ""
				for(var i = 0;i<wanfa.length;i++){
					var html1 = ""
					if(i==2  || i==7 || i==9 || i==10){
						html1+="<section data-max='4' class='playing-method-section'>"+
						"<h1 class='playing-method-section-title'>"+wanfa[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}
					else{	
						html1+="<section data-max='4' class='playing-method-section'>"+
						"<h1 class='playing-method-section-title'><span class='wfname'>"+wanfa[i]+"</span><span style='margin-left:50px;'>赔率："+peilvArray[i][0]+"</span></h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}
					if(i==9){
						for(var j = 0;j<state.length;j++){
						html1 += "<li class='playing-method__item'>"+
						"<ul class='playing-method__cells nostyle'>"+
							"<li class='playing-method__cell'><span class='lottery-prop ball'>"+state[j]+"</span></li>"+
							"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
						"</ul>"+
					"</li>"
						}
					}else if(i==10){
						for(var j = 0;j<total.length;j++){
							if(j<total.length-4){
								html1 += "<li class='playing-method__item'>"+
								"<ul class='playing-method__cells nostyle'>"+
									"<li class='playing-method__cell'><span class='lottery-ball lottery-ball cqssc solid ssc2'>"+total[j]+"</span></li>"+
									"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}else{
								html1 += "<li class='playing-method__item'>"+
								"<ul class='playing-method__cells nostyle'>"+
									"<li class='playing-method__cell'><span class='lottery-prop ball'>"+total[j]+"</span></li>"+
									"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}
						}
					}
					else if(i==1 || i==6){
						html1 += "<li class='playing-method__item all'>"+
						"<ul class='playing-method__cells nostyle'>"+
							"<li class='playing-method__cell'><span class='lottery-prop ball'>"+wanfa[i]+"</span></li>"+
						"</ul>"+
					"</li>"
					}else if(i==5){
						for(var j = 1;j<7;j++){
							html1 += "<li class='playing-method__item kuai3'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(var j = 1;j<7;j++){
							html1 += "<li class='playing-method__item kuai3'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball pk10 solid ball3'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else if(i==3){
						for(var j = 1;j<7;j++){
							html1 += "<li class='playing-method__item kuai3'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball ks solid ks2'>"+j+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(var j = 1;j<7;j++){
							html1 += "<li class='playing-method__item kuai3'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else if(i==7){
						for(var j = 0;j<6;j++){
							html1 += "<li class='playing-method__item kuai3'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc2'>"+Number(j+1)+Number(j+1)+Number(j+1)+"</span></li>"+
								"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
							"</ul>"+
						"</li>"
						}	
					}else if(i==2){
						for(var j = 0;j<6;j++){
							html1 += "<li class='playing-method__item kuai3'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball ks solid ks2'>"+Number(j+1)+Number(j+1)+"</span></li>"+
								"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
							"</ul>"+
						"</li>"
						}	
					}else{
						for(var j = 0;j<6;j++){
							html1 += "<li class='playing-method__item kuai3'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+Number(j+1)+"</span></li>"+
							"</ul>"+
						"</li>"
						}	
					}
					html1 += "</ul>"+
					"</section>"
					html+=html1
				}
				$lotteryType.append(html) 
				 } 
				 if(cnametype == "115"){
					 var wanfa = ["1-5球","总和","标准玩法"]
					 var array=["01","02","03","04","05","06","07","08","09","10","11",""]
					 var array1=["单","双","大","小","01","02","03","04","05","06","07","08","09","10","11"]
					 var array2=["单","双","大","小"]
					 var item = ""
					 for(var i = 0; i<wanfa.length;i++){
						 item += "<li class='playing-methods__item'>"+
							"<a data-id='ofsc-w2' class='item'>"+wanfa[i]+"</a>"+
							"</li>"
					 }
					$lotteryType1.append(item)
					
				var syxwarray=["第一球","第二球","第三球","第四球","第五球","总和","连码-前一直选","连码-前二直选","连码-前三直选","连码-任选一","连码-任选二","连码-任选三","连码-任选四","连码-任选五","连码-任选六","连码-任选七","连码-任选八"] 
				/* var lianma=[] */
				var html = ""
				for(var i = 0;i<syxwarray.length;i++){
					var html1 = ""
					if(i==0){
						html1+="<section style='margin-top:100px;' data-max='6' class='playing-method-section  playing-method-section--column playing-method-section--start' >"+
						"<h1 class='playing-method-section-title'>"+syxwarray[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}else if(i<4 && i>0){
						html1+="<section style='margin-top:100px;' data-max='6' class='playing-method-section  playing-method-section--column'  >"+
						"<h1 class='playing-method-section-title'>"+syxwarray[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}
					else if(i == 4){
						html1+="<section style='margin-top:100px;' data-max='6' class='playing-method-section  playing-method-section--column playing-method-section--end'>"+
						"<h1 class='playing-method-section-title'>"+syxwarray[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}else if(i==5){
						html1+="<section data-max='4' class='playing-method-section'>"+
						"<h1 class='playing-method-section-title'>"+syxwarray[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}
					else{
						html1+="<section data-max='4' class='playing-method-section'>"+
						"<h1 class='playing-method-section-title'>"+syxwarray[i]+"<span style='margin-left:50px;'>赔率："+peilvArray[i][0]+"</span></h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}
					if(i<5){
							for(var j = 0;j<array1.length;j++){
								if(j<4){
									html1 += "<li class='playing-method__item'>"+
									"<ul class='playing-method__cells nostyle'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+array1[j]+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}else{
									html1 += "<li class='playing-method__item'>"+
									"<ul class='playing-method__cells nostyle'>"+
										"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ball0'>"+array1[j]+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
							}
					}else if(i==5){
							for(var j = 0;j<array2.length;j++){
								html1 += "<li class='playing-method__item allNum'>"+
									"<ul class='playing-method__cells nostyle'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+array2[j]+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
							}
					}else if(i==7){
						for(var j = 0;j<array.length;j++){
							if(j==array.length-1){
								html1 += "<li class='playing-method__item kuai3'>"+
								"<ul class='playing-method__cells'>"+
								/* 	"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+array[j]+"</span></li>"+ */
								"</ul>"+
							"</li>"
							}else{
								html1 += "<li class='playing-method__item kuai3'>"+
								"<ul class='playing-method__cells'>"+
									"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+array[j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}
							
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(var j = 0;j<array.length;j++){
							if(j==array.length-1){
								html1 += "<li class='playing-method__item kuai3'>"+
								"<ul class='playing-method__cells'>"+
								"</ul>"+
							"</li>"
							}else{
								html1 += "<li class='playing-method__item kuai3'>"+
								"<ul class='playing-method__cells'>"+
									"<li class='playing-method__cell'><span class='lottery-ball pk10 ball4 solid'>"+array[j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}
							
						}
					}else if(i==8){
						for(var j = 0;j<array.length;j++){
							if(j==array.length-1){
								html1 += "<li class='playing-method__item kuai3'>"+
								"<ul class='playing-method__cells'>"+
								"</ul>"+
							"</li>"
							}else{
								html1 += "<li class='playing-method__item kuai3'>"+
								"<ul class='playing-method__cells'>"+
									"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+array[j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}
							
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(var j = 0;j<array.length;j++){
							if(j==array.length-1){
								html1 += "<li class='playing-method__item kuai3'>"+
								"<ul class='playing-method__cells'>"+
								"</ul>"+
							"</li>"
							}else{
								html1 += "<li class='playing-method__item kuai3'>"+
								"<ul class='playing-method__cells'>"+
									"<li class='playing-method__cell'><span class='lottery-ball pk10 ball4 solid'>"+array[j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}
							
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(var j = 0;j<array.length;j++){
							if(j==array.length-1){
								html1 += "<li class='playing-method__item kuai3'>"+
								"<ul class='playing-method__cells'>"+
								"</ul>"+
							"</li>"
							}else{
								html1 += "<li class='playing-method__item kuai3'>"+
								"<ul class='playing-method__cells'>"+
									"<li class='playing-method__cell'><span class='lottery-ball pk10 solid ball9'>"+array[j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}
						}
					}else {
						for(var j = 0;j<array.length;j++){
							if(j==array.length-1){
								html1 += "<li class='playing-method__item kuai3'>"+
								"<ul class='playing-method__cells'>"+
								"</ul>"+
							"</li>"
							}else{
								html1 += "<li class='playing-method__item kuai3'>"+
								"<ul class='playing-method__cells'>"+
									"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+array[j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}
							
						}
					}
					html1 += "</ul>"+
					"</section>"
					html+=html1
				}
				$lotteryType.append(html)
				 }
				 if(cnametype == "ssl"){	
					 var wanfa = ["前二直选","前二组选","后二直选","后二组选","三星直选","三星和值","三星组三","组三和值","三星组六","组六和值"]
					 var item = ""
					 for(var i = 0; i<wanfa.length;i++){
						 item += "<li class='playing-methods__item'>"+
							"<a data-id='ofsc-w2' class='item'>"+wanfa[i]+"</a>"+
							"</li>"
					 }
					$lotteryType1.append(item)
					
				/* var lianma=[] */
				var html = ""
				for(var i = 0;i<wanfa.length;i++){
					var html1 = ""
						html1+="<section data-max='4' class='playing-method-section'>"+
						"<h1 class='playing-method-section-title'>"+wanfa[i]+"<span style='margin-left:50px;'>赔率："+peilvArray[i][0]+"</span></h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					if(i==0 || i==2 ){
						for(j=0;j<10;j++){
							html1 += "<li class='playing-method__item'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(j=0;j<10;j++){
							html1 += "<li class='playing-method__item'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball ks solid ks2'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else if(i==1 || i==3 || i==6 || i==8){
						for(j=0;j<10;j++){
							html1 += "<li class='playing-method__item'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else if(i==4){
						for(j=0;j<10;j++){
							html1 += "<li class='playing-method__item'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(j=0;j<10;j++){
							html1 += "<li class='playing-method__item'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball ks solid ks2'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(j=0;j<10;j++){
							html1 += "<li class='playing-method__item'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ball0'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else if(i==5){
						for(j=0;j<28;j++){
							html1 += "<li class='playing-method__item'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else if(i==7){
						for(j=1;j<27;j++){
							html1 += "<li class='playing-method__item'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else{
						for(j=3;j<25;j++){
							html1 += "<li class='playing-method__item '>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}	
			
					html1 += "</ul>"+
					"</section>"
					html+=html1
				}
				$lotteryType.append(html)
				 }
 				if(cnametype == "kl10f"){
 					 var wanfa = ["首位数投","首位红投","二连直选","二连组选","前三直选","前三组选","快乐二","快乐三","快乐四","快乐五"]
					 var item = ""
					 for(var i = 0; i<wanfa.length;i++){
						 item += "<li class='playing-methods__item'>"+
							"<a data-id='ofsc-w2' class='item'>"+wanfa[i]+"</a>"+
							"</li>"
					 }
					$lotteryType1.append(item)
					
				/* var lianma=[] */
				var html = ""
				for(var i = 0;i<wanfa.length;i++){
					var html1 = ""
					if(i==0 || i==1){
						html1+="<section data-max='4' class='playing-method-section'>"+
						"<h1 class='playing-method-section-title'>"+wanfa[i]+"</h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}else{
						html1+="<section data-max='4' class='playing-method-section'>"+
						"<h1 class='playing-method-section-title'>"+wanfa[i]+"<span style='margin-left:50px;'>赔率："+peilvArray[i][0]+"</span></h1>"+
						"<ul class='nostyle kd-row lottery-balls'>"
					}
					
					if(i==0){
						for(j=0;j<18;j++){
							if(j<10){
								html1 += "<li class='playing-method__item swst'>"+
								"<ul class='playing-method__cells'>"+
									"<li class='playing-method__cell'><span class='lottery-ball pk10 solid ball4'>0"+Number(j+1)+"</span></li>"+
									"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}else{
								html1 += "<li class='playing-method__item swst'>"+
								"<ul class='playing-method__cells'>"+
									"<li class='playing-method__cell'><span class='lottery-ball pk10 solid ball4'>"+Number(j+1)+"</span></li>"+
									"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
								"</ul>"+
							"</li>"
							}
						
						}
					}
					else if(i==1){
						for(j=0;j<2;j++){
							html1 += "<li class='playing-method__item swht'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball pk10 solid ball4'>"+Number(j+19)+"</span></li>"+
								"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else if(i==2){
						for(j=1;j<21;j++){
							if(j<10){
								j="0"+j
							}
							html1 += "<li class='playing-method__item lianma'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(j=1;j<21;j++){
							if(j<10){
								j="0"+j
							}
							html1 += "<li class='playing-method__item lianma'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball ks solid ks2'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else if(i==4){
						for(j=1;j<21;j++){
							if(j<10){
								j="0"+j
							}
							html1 += "<li class='playing-method__item lianma'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(j=1;j<21;j++){
							if(j<10){
								j="0"+j
							}
							html1 += "<li class='playing-method__item lianma'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball ks solid ks2'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
						html1 += "</ul>"+
						"<ul class='nostyle kd-row lottery-balls'>"
						for(j=1;j<21;j++){
							if(j<10){
								j="0"+j
							}
							html1 += "<li class='playing-method__item lianma'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball pk10 solid ball3'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}else{
						for(j=1;j<21;j++){
							if(j<10){
								j="0"+j
							}
							html1 += "<li class='playing-method__item lianma'>"+
							"<ul class='playing-method__cells'>"+
								"<li class='playing-method__cell'><span class='lottery-ball cqssc solid ssc1'>"+j+"</span></li>"+
							"</ul>"+
						"</li>"
						}
					}
					
					html1 += "</ul>"+
					"</section>"
					html+=html1
				}
				$lotteryType.append(html) 
				 }
				 if(cnametype == "lhc"){
					 var wanfa = ["特码A","特码B","特码生肖","大小单双","家禽野兽","头数","尾数","五行","总和","合数","独平","平码","定肖中特","平特肖","平特尾","平特不中","总肖","色波","半波","半半波"]
					 var wanfaAll=["特码A","特码B","特码生肖","大小单双","家禽野兽","头数","尾数","五行","总和","合数","独平","平码-平二中二","平码-平三中三","平码-平三中二","定肖中特-四肖中肯","定肖中特-五肖中肯","定肖中特-六肖中肯",
					 "平特肖-平特一肖","平特肖-平特二肖","平特肖-平特三肖","平特肖-平特四肖","平特尾-平特一尾","平特尾-平特二尾","平特尾-平特三尾","平特尾-平特四尾","平特不中-5不中","平特不中-6不中","平特不中-7不中","平特不中-8不中",
					 "平特不中-9不中","平特不中-10不中","平特不中-11不中","平特不中-12不中","平特不中-13不中","平特不中-14不中","平特不中-15不中","总肖","色波","半波","半半波"]
					 
					 var animal=["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
					 var state=["大","小","单","双"]
					 var beast=["家肖","野肖","天肖","地肖"]
					 var fiveline=["金","木","水","火","土"]
					 var allAnimal=["单","双"]
					 var colorWave=["红波","蓝波","绿波"]
					 var banbo=["红大","红小","红单","红双","蓝大","蓝小","蓝单","蓝双","绿大","绿小","绿单","绿双"]
					 var banbanbo=["红大单","红大双","红小单","红小双","蓝大单","蓝大双","蓝小单","蓝小双","绿大单","绿大双","绿小单","绿小双"]
					 var blueArr = ["03","04","09","10","14","15","20","25","26","31","36","37","41","42","47","48"]
					 var redArr = ["01","02","07","08","12","13","18","19","23","24","29","30","34","35","40","45","46"]
					 var greenArr = ["05","06","11","16","17","21","22","27","28","32","33","38","39","43","44","49"]
					 var item = ""
					 for(var i = 0; i<wanfa.length;i++){
						 item += "<li class='playing-methods__item'>"+
							"<a data-id='ofsc-w2' class='item'>"+wanfa[i]+"</a>"+
							"</li>"
					 }
					$lotteryType1.append(item)
					
				/* var lianma=[] */
				// 0,1,10`13 25~35
				var html = ""
				for(var i = 0;i<wanfaAll.length;i++){
						var html1 = ""
							if((i>10 && i<14)|| (i>24 && i<36)){
									html1+="<section data-max='4' class='playing-method-section'>"+
									"<h1 class='playing-method-section-title'>"+wanfaAll[i]+"<span style='margin-left:50px;'>赔率："+peilvArray[i][0]+"</span></h1>"+
									"<ul class='nostyle kd-row lottery-balls'>"
							} else if(i==0){
								html1+="<section data-max='4' class='playing-method-section' style='margin-top:120px'>"+
								"<h1 class='playing-method-section-title'>"+wanfaAll[i]+"</h1>"+
								"<ul class='nostyle kd-row lottery-balls'>"
							}else{
									html1+="<section data-max='4' class='playing-method-section'>"+
									"<h1 class='playing-method-section-title'>"+wanfaAll[i]+"</h1>"+
									"<ul class='nostyle kd-row lottery-balls'>"
							}
							
							if(i==2 || (i>13 && i<21)){
								for(j=0;j<animal.length;j++){
										html1 += "<li class='playing-method__item animal'>"+
										"<ul class='playing-method__cells'>"+
											"<li class='playing-method__cell'><span class='lottery-prop ball'>"+animal[j]+"</span></li>"+
											"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
										"</ul>"+
									"</li>"
								}
							}else if(i==3 || i==8 || i==9){
								for(j=0;j<state.length;j++){
									html1 += "<li class='playing-method__item state'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+state[j]+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
							}else if(i==4){
								for(j=0;j<beast.length;j++){
									html1 += "<li class='playing-method__item state'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+beast[j]+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
							}else if(i==5){
								for(j=0;j<5;j++){
									html1 += "<li class='playing-method__item'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+j+"头</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
							}else if(i==6){
								for(j=0;j<10;j++){
									html1 += "<li class='playing-method__item'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+j+"尾</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
								for(j=0;j<state.length;j++){
									html1 += "<li class='playing-method__item'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+state[j]+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j+10]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
							}else if(i==7){
								for(j=0;j<fiveline.length;j++){
									html1 += "<li class='playing-method__item'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+fiveline[j]+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
							}else if(i<2 || i==10){
								for(j=0;j<49;j++){
										html1 += "<li class='playing-method__item lhcQiu'>"+
										"<ul class='playing-method__cells'>"+
											"<li class='playing-method__cell'><span class='lottery-ball lhc solid hb'>"+Number(j+1)+"</span></li>"+
											"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
										"</ul>"+
									"</li>"
								}
							}else if(i>20 && i<25){
								for(j=0;j<10;j++){
									html1 += "<li class='playing-method__item'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+j+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
							}else if(i==36){
								for(j=0;j<6;j++){
									html1 += "<li class='playing-method__item zhongxiao'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+Number(j+2)+"肖</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
								for(j=0;j<allAnimal.length;j++){
									html1 += "<li class='playing-method__item zhongxiao'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+allAnimal[j]+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j+6]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
							}else if(i==37){
								for(j=0;j<colorWave.length;j++){
									html1 += "<li class='playing-method__item colorWave'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+colorWave[j]+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
							}else if(i==38){
								for(j=0;j<banbo.length;j++){
									html1 += "<li class='playing-method__item banbo'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+banbo[j]+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
							}else if(i==39){
								for(j=0;j<banbanbo.length;j++){
									html1 += "<li class='playing-method__item banbanbo'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-prop ball'>"+banbanbo[j]+"</span></li>"+
										"<li class='playing-method__cell'><span class='lottery-odds'>"+peilvArray[i][j]+"</span></li>"+
									"</ul>"+
								"</li>"
								}
							}else{
								for(j=0;j<49;j++){
									html1 += "<li class='playing-method__item lhcQiu'>"+
									"<ul class='playing-method__cells'>"+
										"<li class='playing-method__cell'><span class='lottery-ball lhc solid hb'>"+Number(j+1)+"</span></li>"+
									"</ul>"+
								"</li>"
								}
							}
							html1 += "</ul>"+
							"</section>"
							html+=html1
				}
				$lotteryType.append(html)
				var qiu= $(".playing-method-section .lhcQiu")
				for(i=0;i<qiu.length;i++){
					var qiushu=qiu[i].getElementsByClassName("lottery-ball")[0].innerHTML
					if(qiushu<10){
						qiushu=qiu[i].getElementsByClassName("lottery-ball")[0].innerHTML="0"+qiushu;
					}
					if(blueArr.indexOf(qiushu)!=-1){
						qiu[i].getElementsByClassName("lottery-ball")[0].classList.remove("hb");
						qiu[i].getElementsByClassName("lottery-ball")[0].classList.add("lanb")
					}
					if(greenArr.indexOf(qiushu)!=-1){
						qiu[i].getElementsByClassName("lottery-ball")[0].classList.remove("hb");
						qiu[i].getElementsByClassName("lottery-ball")[0].classList.add("lvb")
					}
				}
			}
				
				 var chouma="<div class='bet-form clearfix bet-form--bottom has-chips'>"+
								"<div class='bet-form__chips'>"+
									"<a class='kd-button kd-button--fit'><i class='icon icon-setting-3'></i>筹码设置</a>"+
									"<ul class='nostyle kd-chips'>"+
										"<li class='kd-chip chip7'><span>5</span></li>"+
										"<li class='kd-chip chip8'><span>10</span></li>"+
										"<li class='kd-chip chip9'><span>20</span></li>"+
										"<li class='kd-chip'><span>50</span></li>"+
										"<li class='kd-chip chip1'><span>100</span></li>"+
									"</ul>"+
								"</div>"+
								"<div class='bet-form__main'>"+
								"<div class='kd-textinput'>"+
								"<div class='kd-textinput__icon'><span>注数</span></div>"+
								"<input class='zhushu' type='number' min='0' step='0.01' value='0' disabled='disabled'>"+
								"</div>"+
									"<div class='kd-textinput'>"+
										"<div class='kd-textinput__icon'><span>金额</span></div> <input class='jine' value='2' type='number' min='1' step='0.01'></div>"+
									"<div type='button' class='kd-button kd-button kd-button--fit recat'>重置 <button type='button'>Button</button></div>"+
									"<div type='button' class='kd-button kd-button kd-button--fit bet-form__submit'><span class='tijiao'>提交注单</span><button type='button'>Button</button></div>"+
								"</div>"

							"</div>"
				 $lotteryType.append(chouma)
				 var chipsLen=$(".kd-chips").length;
							
				/* 监听金额的变化 */
				 $(".jine").bind("input propertychange",function(){
					$(".jine").val($(this).val())
				})			
							
				//点击选择金额
				 $(".kd-chips .kd-chip").on("click",function(e){
					 var index=$(this).index();
					 var money=$(".jine").val();
					 for(i=0;i<chipsLen;i++){
						 $($(".kd-chips")[i]).find(".kd-chip").removeClass("checked")
						 $($(".kd-chips")[i]).find(".kd-chip").eq(index).addClass("checked")
					 }
					 var charge=$(".kd-chips").find(".kd-chip").eq(index).text()
					 money=Number(charge) 
					$(".jine").val(money)
				}) 
				if($(".jine").val()==""){
					$(".jine").val(2)
				}
				//重置
				 $(".recat button").on("click",function(){
					$(".playing-method__item").removeClass("act")
					$(".zhushu").val(0)
					$(".jine").val(2)
					$(".kd-chip").removeClass("checked")
				}) 
				
				
				
				
				//选择筹码
				$(".bet-form__chips .kd-button--fit").on("click",function(){
					if($(this).hasClass("active")){
						$(this).removeClass("active")
						$(".bet-form__chipsetting").remove()
					}else{
						$(this).addClass("active")
						var html=""
						html+="<div class='bet-form__chipsetting'>"+
									"<ul class='nostyle kd-chips'>"+
									"<li class='kd-chip chip7'><span>5</span></li>"+
									"<li class='kd-chip chip8'><span>10</span></li>"+
									"<li class='kd-chip chip9'><span>20</span></li>"+
									"<li class='kd-chip'><span>50</span></li>"+
									"<li class='kd-chip chip1'><span>100</span></li>"+
									"<li class='kd-chip chip2'><span>500</span></li>"+
									"<li class='kd-chip chip3'><span>1千</span></li>"+
									"<li class='kd-chip chip4'><span>2千</span></li>"+
									"<li class='kd-chip chip5'><span>5千</span></li>"+
									"<li class='kd-chip chip6'><span>1万</span></li>"+
								"</ul>"+
								"<div type='button' class='kd-button kd-button kd-button--fit bet-form__chipsave'>确定 <button type='button'>Button</button></div>"+
								"<a title='取消' class='bet-form__close'><i class='icon icon-times'></i></a>"+
							"</div>"
						$(".bet-form__main").after(html)
					}
					//确认选择的筹码
					$(".bet-form__chipsetting").on("click",".kd-chip",function(){
						if($(this).hasClass("checked")){
							$(this).removeClass("checked")
						}else{
							//最多选5个筹码
							if($(".bet-form__chipsetting .checked").length>4){
								PrentLayerLittle("提示","对不起,最多只能选择5个筹码")
								/* $(".div-c-noticeContentDiv .message-tip-body").text("对不起,最多只能选择5个筹码")
								$(".div-c-noticeContentDiv").removeClass("bounceOut").addClass("bounceIn").show() 
								 setTimeout(function(){$(".div-c-noticeContentDiv").removeClass("bounceIn").addClass("bounceOut")},1000); */
							}else{
								$(this).addClass("checked")
							}
						}
					})
					
					//点击确定
					 $(".bet-form__chipsetting").on("click","button",function(){
						//判断筹码个数
						var select
						 select=$(".bet-form__chipsetting .checked")
						var html=""
						if(select.length==0){
							PrentLayerLittle("提示","请至少选择一个筹码")
							/* $(".div-c-noticeContentDiv .message-tip-body").text("请至少选择一个筹码")
							$(".div-c-noticeContentDiv").removeClass("bounceOut").addClass("bounceIn").show() 
							 setTimeout(function(){$(".div-c-noticeContentDiv").removeClass("bounceIn").addClass("bounceOut")},1000); */
						}else{
							$(".bet-form__chips .kd-chips").empty();
							for(i=0;i<select.length;i++){
								var item=select[i]
								$(".bet-form__chips .kd-chips").append(item)
							}
							$(".bet-form__chips").find(".kd-button--fit").removeClass("active")
							$(".bet-form__chipsetting").remove()
							$(".bet-form__chips").find(".kd-chip").removeClass("checked")
						}
						 $(".kd-chips .kd-chip").on("click",function(e){
							 var index=$(this).index();
							 var money=$(".jine").val();
							 for(i=0;i<chipsLen;i++){
								 $($(".kd-chips")[i]).find(".kd-chip").removeClass("checked")
								 $($(".kd-chips")[i]).find(".kd-chip").eq(index).addClass("checked")
							 }
							 var charge=$(".kd-chips").find(".kd-chip").eq(index).find("span").text()
							 if(charge=="1千"){
								 charge=1000 
							 }else if(charge=="2千"){
								 charge=2000 
							 }else if(charge=="5千"){
								 charge=5000 
							 }else if(charge=="1万"){
								 charge=10000 
							 }
							 money=Number(charge) 
							$(".jine").val(money)
						})
					}) 
					
					//点击关闭
					$(".bet-form__chipsetting").on("click",".icon-times",function(){
						$(".bet-form__chips").find(".kd-button--fit").removeClass("active")
						$(".bet-form__chipsetting").remove()
					})
				})
				//点击玩法自动滚到该位置
				var play=$(".game-main__head .playing-methods .playing-methods__item")
				play.on("click",function(){
					var index=$(this).index();
					var WFoffset
					var WFname=$(".playing-method-section .playing-method-section-title")
					if(cnametype=="ssc" || cnametype=="pk10"){
						if(index<2){
							$("html,body").animate({scrollTop:$(WFname[index]).offset().top-275}, 500);
						}else{
							$("html,body").animate({scrollTop:$(WFname[index+4]).offset().top-275}, 500);
						}	
					}else if(cnametype=="kuai3" || cnametype=="ssl" || cnametype=="kl10f" || cnametype=="pcdd" ){
						$("html,body").animate({scrollTop:$(WFname[index]).offset().top-275}, 500);
					}else if(cnametype=="115"){
						if(index==0){
							$("html,body").animate({scrollTop:$(WFname[index]).offset().top-275}, 500);
						}else{
							$("html,body").animate({scrollTop:$(WFname[index+4]).offset().top-275}, 500);
						}
					}else if(cnametype=="lhc"){
						if(index<12){
							$("html,body").animate({scrollTop:$(WFname[index]).offset().top-300}, 500);
						}else if(index==12 || index==13){
							$("html,body").animate({scrollTop:$(WFname[3*index-22]).offset().top-300}, 500);
						}else if(index==14 || index==15){
							$("html,body").animate({scrollTop:$(WFname[4*index-35]).offset().top-300}, 500);
						}else{
							$("html,body").animate({scrollTop:$(WFname[index+20]).offset().top-300}, 500);
						}
					}
				})
			/* 	*getQiu */
		 	
			//设置部分玩法球选择的最多个数
			if(cnametype=="pk10" || cnametype=="ssc" || cnametype=="115" || cnametype=="lhc"){
				var getqiu
				if(cnametype=="pk10"){
					getqiu="bjpk10"
				}else if(cnametype=="ssc"){
					getqiu="cqssc"
				}else if(cnametype=="115"){
					getqiu="gd11x5"
				}else if(cnametype=="lhc"){
					getqiu="xg6hc"
				}
				$.ajax({
					url:  '/lotter/getQiu.do',
					type: "post",
					data: {cname:getqiu},
					success: function(data) {
						$("div").data("newData1",data)
					},
					error: function(data) {
						PrentLayerLittle("提示：", "网络异常，请检查网络")
						//showNormalNoticeModal("#div-i-noticeGenDan", "提示：", "网络异常")
					}
				}) 
			}
			 }
			
			
			
			 var isReal
			 var arrTmb3=[]
			$(".game-main__body").on("click",".playing-method__item",function(e){
				if(!whetherToLogin){
					goToLoginLayer("提示","你还没有登录,登录后可投注噢")
					return;
				}
				 var newData = $("div").data(newData)
				 var newData1 = $("div").data(newData1) 
				 var data = newData.newData
				var $self = $(e.currentTarget)
				var $btnChild = $self.find("span").eq(0)
				var btnValue=$btnChild.text()
				var wanfa = $self.parent().prev().text();
				 var cnametype = data.classt.split(" ")[2]
				if($self.hasClass("act")){
					$self.removeClass("act")
				}else{
						if(cnametype!="lhc"){
							var wanfa=$(this).parent().parent().find("h1").text()
							if(wanfa.indexOf("赔率")!=-1){
								 var WFwup=wanfa.indexOf("赔率")
								 wanfa=wanfa.substring(0,WFwup)
							 }
							if($(this).find(".lottery-ball").text()==""){
									$self.addClass("act")
									if(!$(".musicFlag").hasClass("status--off")){
										Lotbet.play();    //选中出现声音
									}
									
							}else{
								if(newData1.newData1==undefined){
									$self.addClass("act")
									if(!$(".musicFlag").hasClass("status--off")){
										Lotbet.play();    //选中出现声音
									}
								}else{
									var actQiu=newData1.newData1.data[0].kongzhisl
									if($(this).parent().find(".act").find(".lottery-ball").length<actQiu){
											$self.addClass("act")
											if(!$(".musicFlag").hasClass("status--off")){
												Lotbet.play();    //选中出现声音
											}
									/* if(cnametype=="ssc"){
										if(wanfa.substring(0,2)=="连码"){
											var wanfa1=wanfa.split("-")[1]
											var number=wanfa1.substring(1,2)
											var number1=wanfa1.substring(2,3)
											var number2=wanfa1.substring(3,4)
											if(number1=="直" && $(this).parent().find(".act").length!=0){
												var sectionUl=$(this).parent().parent().find(".kd-row")
												$("	.game-main__body").on("click",".playing-method__item",function(){
													var wanfa1=$(this).parent().parent().find("h1").text()
													if(wanfa1.indexOf("赔率")!=-1){
														 var WFwup1=wanfa1.indexOf("赔率")
														 wanfa1=wanfa1.substring(0,WFwup1)
													 }
													if(wanfa1!=wanfa){   //此处有小BUG，能力有限，先放着
														var qiu
														for(i=0;i<sectionUl.length;i++){
															var item=sectionUl[i]
															qiu=item.getElementsByClassName("act").length
														}
														if(sectionUl.find(".act").length!=0 && qiu==0){
															$(".div-c-noticeContentDiv .message-tip-body").text(wanfa+"每种颜色球至少选一个")
															$(".div-c-noticeContentDiv").show();
															setTimeout(function(){$(".div-c-noticeContentDiv").hide()},1000);  //一秒后弹窗自动关闭 
															  if($(this).hasClass("act")){
																$(this).removeClass("act")
															}else{
																$(this).addClass("act")
															}  
														}
													}else{
														return false;
													}
												})
											}else{
												return false;
											}
										}else{
											return false;
										}
									} */
									}else{
										PrentLayerLittle("提示",wanfa+"最多只能为"+actQiu+"个球")
										/* $(".div-c-noticeContentDiv .message-tip-body").text(wanfa+"最多只能为"+actQiu+"个球")
										$(".div-c-noticeContentDiv").removeClass("bounceOut").addClass("bounceIn").show() 
										 setTimeout(function(){$(".div-c-noticeContentDiv").removeClass("bounceIn").addClass("bounceOut")},1000);  //一秒后弹窗自动关闭 */
									}
								}
							}
						}else{	
							var newData=newData1.newData1.data;
							var actQiu
							 for(i=0;i<newData.length;i++){
								 actQiu=newData[i].kongzhisl
								 var wanfa=$(this).parent().parent().find("h1").text()
								 if(wanfa=="特码A" || wanfa=="特码B"){
									 if(i==7){
										 if($(this).parent().find(".act").length<actQiu){
											 $self.addClass("act")
											 if(!$(".musicFlag").hasClass("status--off")){
													Lotbet.play();    //选中出现声音
												}
										 }else{
											 PrentLayerLittle("提示",wanfa+"最多只能选"+actQiu+"个球")
											/*  $(".div-c-noticeContentDiv .message-tip-body").text(wanfa+"最多只能选"+actQiu+"个球")
											 $(".div-c-noticeContentDiv").removeClass("bounceOut").addClass("bounceIn").show() 
											 setTimeout(function(){$(".div-c-noticeContentDiv").removeClass("bounceIn").addClass("bounceOut")},1000); */
										 }
									 }
								 }else if(wanfa.substring(0,4)=="平特不中"){
									  var WFwup=wanfa.indexOf("赔")
									 var wanfa1=wanfa.substring(0,WFwup)
									 var number=wanfa.split("-")[1]
									 var sup=number.indexOf("不")
									 number=number.substring(0,sup)
									 if(i==0 && 4<number && number<9){
										 if($(this).parent().find(".act").length<actQiu){
											 $self.addClass("act")
											 if(!$(".musicFlag").hasClass("status--off")){
													Lotbet.play();    //选中出现声音
												}
										 }else{
											 PrentLayerLittle("提示",wanfa1+"最多只能选"+actQiu+"个球")
											/*  $(".div-c-noticeContentDiv .message-tip-body").text(wanfa1+"最多只能选"+actQiu+"个球")
											 $(".div-c-noticeContentDiv").removeClass("bounceOut").addClass("bounceIn").show() 
											 setTimeout(function(){$(".div-c-noticeContentDiv").removeClass("bounceIn").addClass("bounceOut")},1000); */
										 } 
									 }else if(i==1 && (number==9 || number==10)){
										 if($(this).parent().find(".act").length<actQiu){
											 $self.addClass("act")
											 if(!$(".musicFlag").hasClass("status--off")){
													Lotbet.play();    //选中出现声音
												}
										 }else{
											 PrentLayerLittle("提示",wanfa1+"最多只能选"+actQiu+"个球")
											/*  $(".div-c-noticeContentDiv .message-tip-body").text(wanfa1+"最多只能选"+actQiu+"个球")
											 $(".div-c-noticeContentDiv").removeClass("bounceOut").addClass("bounceIn").show() 
											 setTimeout(function(){$(".div-c-noticeContentDiv").removeClass("bounceIn").addClass("bounceOut")},1000); */
										 } 
									 }else if(number==i+9){
										 if($(this).parent().find(".act").length<actQiu){
											 $self.addClass("act")
											 if(!$(".musicFlag").hasClass("status--off")){
													Lotbet.play();    //选中出现声音
												}
										 }else{
											 PrentLayerLittle("提示",wanfa1+"最多只能选"+actQiu+"个球")
											/*  $(".div-c-noticeContentDiv .message-tip-body").text(wanfa1+"最多只能选"+actQiu+"个球")
											 $(".div-c-noticeContentDiv").show() 
											 setTimeout(function(){$(".div-c-noticeContentDiv").removeClass("bounceIn").addClass("bounceOut")},1000); */
										 }  
									 }
								 }else{
									 $self.addClass("act") 
									 if(!$(".musicFlag").hasClass("status--off")){
											Lotbet.play();    //选中出现声音
										}
								 }  
							} 
						}
				}
				 if(cnametype=="pk10"){
					 var isLeftValue = btnValue == "单" || btnValue == "大" || btnValue == "龙"
					 var isRightValue = btnValue == "双" || btnValue == "小" || btnValue == "虎"
					 if ($self.hasClass("act") && isLeftValue) {
							$self.next().removeClass("act")
						}
						else if ($self.hasClass("act") && isRightValue) {
							$self.prev().removeClass("act")
						}
				 }
				
				 if(cnametype=="pcdd"){
					 var isLeftValue = btnValue == "单" || btnValue == "大" || btnValue == "大单" || btnValue == "小单" || btnValue == "极大" 
					 var isRightValue = btnValue == "双" || btnValue == "小"|| btnValue == "大双" || btnValue == "小双" || btnValue == "极小"
					 if ($self.hasClass("act") && isLeftValue) {
							$self.next().removeClass("act")
						}
						else if ($self.hasClass("act") && isRightValue) {
							$self.prev().removeClass("act")
						}
					 if(wanfa=="特码包三"){
						 if($self.hasClass('act')){
								arrTmb3.push($self.find('.pcdd').text())
							}else{
								 var index=arrTmb3.indexOf($self.find('.pcdd').text())
								arrTmb3.splice(index,1)
							}
						 var actLen=$self.parent().find('.act')
						 if(arrTmb3.length==4){
								for(i=0;i<actLen.length;i++){
									if(actLen.eq(i).find('.pcdd').text()==arrTmb3[0]){
										actLen.eq(i).removeClass('act')
										arrTmb3.shift()
										return;
									}
								}
							}
					 }
				 }
				 if(cnametype=="ssc"){
					 var isLeftValue = btnValue == "单" || btnValue == "大"
					var isRightValue = btnValue == "双" || btnValue == "小"
					var isLongHuValue = btnValue == "龙" || btnValue == "虎" || btnValue == "和" 
					 if ($self.hasClass("act") && isLeftValue) {
							$self.next().removeClass("act")
						}
						else if ($self.hasClass("act") && isRightValue) {
							$self.prev().removeClass("act")
						}
						else if ($self.hasClass("act") && isLongHuValue) {
							if (btnValue == "龙") {
								$self.next().removeClass("act").next().removeClass("act")
							}
							else if (btnValue == "虎") {
								$self.next().removeClass("act")
								$self.prev().removeClass("act")
							}
							else {
								$self.prev().removeClass("act").prev().removeClass("act")
							}
						}
				 }
				 
				 if(cnametype=="kuai3" || cnametype=="115"){
					 var isLeftValue = btnValue == "大" || btnValue == "单"
							var isRightValue = btnValue == "小" || btnValue == "双"
							if (isLeftValue) {
								$self.next().removeClass("act")
							}
							else if (isRightValue) {
								$self.prev().removeClass("act")
							}
					 var $parent = $self.parent()
						 if ($parent.prev().find(".wfname").length > 0) {
							var titleVaue1 = $parent.prev().find(".wfname").text()
							 if (titleVaue1.indexOf("二同号单选") != -1 || titleVaue1.indexOf("二不同号胆拖") != -1) {
								var index = $self.index()
								$parent.next().find(".kuai3").eq(index).removeClass("act")					
							} 
						}
						 else if ($parent.prev().prev().find(".wfname").length > 0) {
							var titleVaue2 = $parent.prev().prev().find(".wfname").text()
							if (titleVaue2.indexOf("二同号单选") != -1 || titleVaue2.indexOf("二不同号胆拖") != -1) {
								var index = $self.index()
								$parent.prev().find(".kuai3").eq(index).removeClass("act")					
							}				
						}  
				 }
				 if(cnametype=="lhc"){
					var isDoubleLeftValue = btnValue.indexOf("大单") != -1 ||  btnValue.indexOf("小单") != -1
					var isDoubleRightValue = btnValue.indexOf("大双") != -1  ||  btnValue.indexOf("小双") != -1
					var isLeftValue = btnValue.indexOf("单") != -1  || btnValue.indexOf("大") != -1 || btnValue.indexOf("家肖") != -1 || btnValue.indexOf("天肖") != -1 
					var isRightValue = btnValue.indexOf("双") != -1 || btnValue.indexOf("小") != -1 || btnValue.indexOf("野肖") != -1 ||  btnValue.indexOf("地肖") != -1 
					if ($self.hasClass("act")) {
						if (isDoubleLeftValue) {
							$self.next().removeClass("act")
						}
						else if (isDoubleRightValue) {
							$self.prev().removeClass("act")
						}
						else if (isLeftValue) {
							$self.next().removeClass("act")
						}
						else if (isRightValue) {
							$self.prev().removeClass("act")
						}
					}
				 }
			 	var ajaxData = {
					url:  '/orders/awards1.do',
					type: "post",
					data: {
					    lotterid: data.id,
						cname: data.cname,
						cname1:data.name,
						period: $(".nextperiod").text(),
					},
					success: function(data) {
						 var newData = JSON.parse(data)
						 lotter_count = newData.data;
						 lotter_rebate = newData.message;
						 $(".zhushu").val(newData.data)
					},
					error: function(data) {
						$(e.currentTarget).removeClass("act")
						PrentLayerLittle("提示：", "网络异常，请检查网络")
						//showNormalNoticeModal("#div-i-noticeGenDan", "提示：", "网络异常")
					}
				}	
			 	if(!whetherToLogin){
					 PrentLayerLittle("提示：", "登录后才可以投注哦")
					 return
				 }
				setAllActItem(ajaxData.data)
				ajax(ajaxData) 	
			})
			//
			/*  $(".bet-form__chips .kd-chip").on("click",function(){
			 })
			 */
			$(".playModule").on("click",".bet-form__submit",function(){
				if(!whetherToLogin){
					 PrentLayerLittle("提示：", "登录后才可以投注哦")
					 return
				}
				var h = parseInt(daojishi/ 60 / 60 % 60) //时
			    var m = parseInt(daojishi/ 60 % 60)  //分
			 	var s = parseInt(daojishi% 60)  //秒
				if(h<= 0 && m <=0 && s <= 30){
					return
				}
				var newData = $("div").data(newData) 
				var data = newData.newData
			 	var ajaxData1 = {
					url:  '/orders/awards.do',
					type: "post",
					data: {
					    lotterid: data.id,
						cname: data.cname,
						cname1:data.name,
						period: $(".nextperiod").text(),
						lottermoney: $(".jine").val(),
						odds: 1, //1位普通订单-2为合买订单
					},
					success: function(data) {
						 var newData = JSON.parse(data)
						if(newData.data == 10){
							if(newData.message=="下注注数不正确!"){
								 PrentLayerLittle("提示：", "请选择下注号！")
								// $(".div-c-noticeContentDiv .message-tip-body").text("请选择下注号！")
								/*  $(".div-c-noticeContentDiv").removeClass("bounceOut").addClass("bounceIn").show() 
								 setTimeout(function(){$(".div-c-noticeContentDiv").removeClass("bounceIn").addClass("bounceOut")},1000);  */ 
							}else if(newData.message == "当前彩种已关闭，无法进行下单!"){
								 PrentLayerLittle("提示：", "当前彩种已关闭，无法进行下单!")
							}
						 }else if(newData.data == "余额不足,请充值后投注!"){
							 PrentLayerLittle("提示：", "余额不足,请充值后投注!")
						 }else {
							 /* var parentUl = document.querySelector(".ul-c-betSuccessItem") */
							 var wanfaHTML = ""
									for (var i = 1; i <= 40; i++) {
										var item = newData.data["cplay" + i]
										if (item != null) {
											var value = "<td>" + newData.data["cplay" + i] + "</td><td>" + newData.data["str" + i] + "</td>"
											value = "<tr>" + value + "</tr>"
											wanfaHTML += value
										}
									}
									var shouyizhi = (Number(newData.data.lottermoney) * Number(lotter_rebate)).toFixed(2)
									/* parentUl.innerHTML = "<tr><td>投注期号</td><td><span style='color:black;font-weight:bold;'>" + newData.data.period + "</span></td></tr>" + 
									"<tr><td>投注注数</td><td><span style='color:red;font-weight:bold;'>" + lotter_count+ " 注</span></td></tr>"+
									"<tr><td>投注金额</td><td><span style='color:red;font-weight:bold;'>" + newData.data.acount + " 元</span></td></tr>"+
									"<tr><td>预估收益值</td><td><span style='color:red;font-weight:bold;'> " + shouyizhi + " 元</span></td></tr>"+
									"<tr class='wanfa-li-special'><td style='font-weight:bold;'>玩法</td><td style='font-weight:bold;'>投注号码</td></tr>"+ wanfaHTML */
									XIAZHU_BTN_LOCK = true
									/* $("#betSuccessModal").modal("show") */
									PrentLayerLittle("提示：", "投注成功，祝您中奖！")
								 //$(".div-c-noticeContentDiv .message-tip-body").text("投注成功，祝您中奖！")
								/*  $(".div-c-noticeContentDiv").removeClass("bounceOut").addClass("bounceIn").show() 
								 setTimeout(function(){$(".div-c-noticeContentDiv").removeClass("bounceIn").addClass("bounceOut")},1000);  */
								 BindmyOrders()
								  $(".game-main__body .playing-method__item").removeClass("act") 
								  $(".zhushu").val("0") 
						 }
						
					},
					error: function(data) {
						$(e.currentTarget).removeClass("act") 
						PrentLayerLittle("提示：", "网络异常，请检查网络")
						//showNormalNoticeModal("#div-i-noticeGenDan", "提示：", "网络异常")
					}
				}		
				setAllActItem(ajaxData1.data)
				ajax(ajaxData1)  
			})
			
			$(".lotteryType").on("click",".musicFlag",function(){  //声音开关
				if($(this).hasClass("status--off")){  //点击后开启声音
					$(this).removeClass("status--off")
				}else{ //点击后关闭声音
					$(this).addClass("status--off")
				}
			})
			
			 function setAllActItem(dataObj) {
				var allActDivs = $(".game-main__body .lottery-balls")
				for (var i = 0; i < allActDivs.length; i++) {
					var item = allActDivs[i]
					var strValue = ""
					var strs = $(item).find(".act")
					for (var j = 0; j < strs.length; j++) {
						 strValue += $(strs[j]).find("span").eq(0).text() + ","  
						
					}
					 dataObj["str" + Number(i + 1)] = strValue 
				}
					
			}
			 var isIphone = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)  //手机端
			 var musicPath="";   //播放音乐的前面的路劲
			 var Lotbet   //下注声音的对象
			 var LotDown  //倒计时声音的对象
			 function bindMusicInit(){   //初始化MP3的声音
				 if(isIphone){
					 musicPath =  "/music/"
					} else {
						musicPath =  "/music/android/"
				    }
				 var lotOp=musicPath+"bet_select.mp3"
				 var lotDown=musicPath+"ding.mp3"
					 Lotbet=new Howl({
						src:[lotOp]
					})
					
					LotDown=new Howl({
						src:[lotDown]
					})
			 }
			 
			 $(".tryplay").on("click",function(){
				 $.post('/u/tryPlayAcount.do',{},function(result){
						$('#tryPlayAcount').val(result.data);
					});
				 $(".free_play_modal").show();
			 })
			 
			 $('#free_play_yes').on('click',tryPlaying);
			 
			 
			 function tryPlaying(){
					var acount = $('#tryPlayAcount').val();
					var pwd = $('#tryPlayPwd').val();
					$.post('/u/tryplay.do',{name:acount,pass:pwd},function(result){
						if(pwd==""){
							PrentLayerLittle("提示：", "请输入试玩密码")
							return;
						}
						$(".free_play_modal").hide();
						if(result.message == 10){
							//已经在登录状态啦
							PrentLayerLittle("提示：", "你已经在登录状态！不可在登录")
							return;
						}
						if(result.message == 3){
							//已经在登录状态啦
							PrentLayerLittle("提示：", "用户名已经存在,请更换用户名")
							return;
						}
						if(result.message == 2){
							//已经在登录状态啦
							PrentLayerLittle("提示：", "你ip试玩次数过多，请明天在来吧")
							return;
						}
						
						layer.open({
						    type: 1,
						    area:['200px',"100px"],
						    title:false,
						    shadeClose: true, //点击遮罩关闭
						    anim: 3,
						    content: '登录成功',    //右边也可以自己定义样式，引用时最外面的那个id,如$("#"+"ID名")
						    btn:'知道了',
						  });
						whetherToLogin=true;
						$(".tryplay").hide();
						$(".backLogin")[0].style.display="inline-block";
					});
				}
			 
			 $(".free_play_modal").on("click","#free_play_no",function(){
				$(".free_play_modal").hide()
			})
			
			$(".backLogin").on("click",function(){
				$.post('/pc/exit.do',{},function(result){
					whetherToLogin=false;
					$(".backLogin").hide();
					$(".tryplay")[0].style.display="inline-block";
				});
			})
			 bindMusicInit()
			 
			 /* 联系客服 */
			 $(".link-kefu").on("click",function(){
				 if(!whetherToLogin){
					goToLoginLayer("提示","你还没有登录,登录后可投注噢")
					return;
				}
				 window.open("/pc/kefu.do","_blank");
			 })
			 
			 
			 function pageChange(adress,cname){
				 localStorage.setItem("adress",adress)
				 localStorage.setItem("cname",cname)
				 window.location.href="/pc/index.do"
			 }
		</script>
</body>
</html>